﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO;
using System.ComponentModel;

namespace SilverlightFTP
{
    public class FTPDownloadFileOperation : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public int Progress
        {
            get
            {
                double ds = dataRecieved;
                double dl = datalength;
                double p = ds / dl;
                return Convert.ToInt32(p * 100);
            }

        }
        public Stream fileStream;
        public Stream FileStream
        {
            get { return fileStream; }
            set { fileStream = value; }
        }
        private string fileName;
        public string FileName
        {
            get { return fileName; }
            set { fileName = value; }
        }
        public string hostdestination;
        public bool allowed;
        public long datalength;
        public int chunklegth = 8 * 4096;
        private int dataRecieved;
        public int DataRecieved
        {
            get { return dataRecieved; }
            set
            {
                dataRecieved = value;
                if (PropertyChanged != null)
                {

                    PropertyChanged(this, new PropertyChangedEventArgs("Progress"));
                }
            }
        }
    }
}
